<!-- papers.html -->
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="inc/examHeader::header">
</head>
<script type="text/javascript" src="/exam/js/papers.js" ></script>
	<body>
		<!--返回-->
		<div class="back" onclick="location='/index'"><img src="../images/back.png" /></div>
		<div th:include="header :: header"></div>
		<div class="header-title">
			<span>试卷管理</span>
		</div>
		<div class="spare-a">
			<div class="questions-ar">
				<div class="spare-ara">
					<div class="spare-ara-a clearfix">
						<div class="spare-ara-al">
							<div class="spare-ara-all"><input type="text" placeholder="请输入关键字" id="search"/></div>
							<div class="spare-ara-alr" onClick="js_method()"></div>
						</div>
						<div class="spare-ara-ar">
							<a href="/paperManager/papers-add"  class="spare-tj"  shiro:hasPermission="sys:paper:add">添 加</a>
							<a href="#" id="papers-updata" class="spare-tj"  shiro:hasPermission="sys:paper:imp">导 入</a>
							<a href="#" id="papers-downdata" class="spare-tj"  shiro:hasPermission="sys:paper:exp">导 出</a>
							<a href="#" class="spare-qx" sel="Y" style="display:none" hid='Y' shiro:hasPermission="sys:paper:del">全 选</a>
							<a href="#" id="papers-edit" class="spare-edit" style="display:none" hid='Y' shiro:hasPermission="sys:paper:edit">编 辑</a>
							<a href="#" id="papers-delete" onclick="papersDelete()" class="spare-del" style="display:none" hid='Y' shiro:hasPermission="sys:paper:del">删 除</a>
						</div>
					</div>
					<div class="srcoll-documentation" id="srcoll-documentation" shiro:hasPermission="sys:paper:view">
					<div class="documentation paper">
						<ul class="lists" id="lists">
							<!-- <a href="#" th:onclick="'javascript:yulan(\''+*{id}+'\')'" th:each="paper,index:${papers}" th:object="${paper}">
							<li>
								<div hidden="hidden">
									<input type="checkbox" name="checkbox" th:value="*{id}" />
				          			<input type="hidden" th:id="*{id}" th:value="${index.count}"/>
				          			<input type="hidden" th:id="*{'status-'+id}" th:value="*{status}"/>
								</div>
								<div class="paper-a" th:text="*{'试卷名称:'+name}"></div>
								<div class="paper-b" ><span style="padding-left:0px" th:text="*{'考试时长（分钟）:'+totalTime}"></span><span th:text="*{'试卷类型:'+examType}">试卷类型：考试试卷</span><span th:text="*{'总分:'+totalScore}">总分：100</span></div>
								<div class="paper-c" th:text="*{'创建日期:'+createDate}"></div>
								<div class="documentation-check"></div>
							</li>
							</a> -->
						</ul>
					</div>
					</div>
				</div>
			</div>
		</div>
		
		
		<script th:inline="javascript">  
/*<![CDATA[*/
           $(function() {	
	 		loadDataPage("/paperManager/findByPage", "srcoll-documentation",
					"lists", 12, "search"); 
		});
		//构建数据列表
 		function dataKk(data, me) {
			var result = '';
			var arrLen = data.length;
			if (arrLen > 0) {
				for (var i = 0; i < arrLen; i++) {
					result += '<a href="/paperManager/preview?id='+data[i].id+'">' + '<li id="'+data[i].id+'">'
							+ '<div class="paper-a">试卷名称：' + data[i].name+ '</div>'
							+ '<div class="paper-b">考试时长：' + data[i].totalTime + '<span>试卷类型：' + data[i].examType+ '</span>'+'<span>总分：' + data[i].totalScore+ '</span>'+ '</div>'
							+ '<div class="paper-c">创建日期：' + data[i].createDate+ '</div>'
							+'<div hidden="hidden"><input type="checkbox"   name="ids" value="'+data[i].status+'"/></div>'
							+ '<div class="documentation-check"></div>'
							+ '</li>' + '</a>'
				}
			} else {
				me.lock();
				me.noData();
			}
			return result; 
		} 
		 
 		function js_method() {
 			$(".dropload-down").remove();
 			$('#lists').html("");
 			loadDataPage("/paperManager/findByPage/", "srcoll-documentation", "lists", 12,"search");	
 		}
 
           /*]]>*/  
</script>
		
		
		
		
		
	</body>
</html>
